package domain;
// Generated 13-jul-2009 12:36:24 by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Wcontract generated by hbm2java
 */
@Entity
@Table(name="wcontract"
    ,catalog="domeco"
)
public class Wcontract  implements java.io.Serializable {


     private Integer idWcontract;
     private Bankaccount bankaccount;
     private String workName;
     private double basicSalary;
     private Set<Salary> salaries = new HashSet<Salary>(0);

    public Wcontract() {
    }

	
    public Wcontract(Bankaccount bankaccount, String workName, double basicSalary) {
        this.bankaccount = bankaccount;
        this.workName = workName;
        this.basicSalary = basicSalary;
    }
    public Wcontract(Bankaccount bankaccount, String workName, double basicSalary, Set<Salary> salaries) {
       this.bankaccount = bankaccount;
       this.workName = workName;
       this.basicSalary = basicSalary;
       this.salaries = salaries;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="idWcontract", unique=true, nullable=false)
    public Integer getIdWcontract() {
        return this.idWcontract;
    }
    
    public void setIdWcontract(Integer idWcontract) {
        this.idWcontract = idWcontract;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="bankFK", nullable=false)
    public Bankaccount getBankaccount() {
        return this.bankaccount;
    }
    
    public void setBankaccount(Bankaccount bankaccount) {
        this.bankaccount = bankaccount;
    }
    
    @Column(name="workName", nullable=false, length=250)
    public String getWorkName() {
        return this.workName;
    }
    
    public void setWorkName(String workName) {
        this.workName = workName;
    }
    
    @Column(name="basicSalary", nullable=false)
    public double getBasicSalary() {
        return this.basicSalary;
    }
    
    public void setBasicSalary(double basicSalary) {
        this.basicSalary = basicSalary;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="wcontract")
    public Set<Salary> getSalaries() {
        return this.salaries;
    }
    
    public void setSalaries(Set<Salary> salaries) {
        this.salaries = salaries;
    }




}


